const mongoose = require('mongoose')



const users = mongoose.Schema({
    phone: String,
    username: String,
    password: String,
    nickname: String,
    status: {
        type: Number,
        enum: [1, 2], //  1表示用户可以使用 2 表示用户被禁用
        default: 1
    },
    age: Number,
    headerImg: {
        type: String,
        default: '/public/img/default.webp'
    },
    gender: {
        type: String,
        enum: ['男', '女', '保密'],
        default: '保密'
    },
    createTime: {
        type: Date,
        default: new Date()
    }
})

const UserModel = mongoose.model('users', users)




module.exports = {
    UserModel
}